name: Publish Library

on:
  push:
    branches:
      - release

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up JDK 1.8
      uses: actions/setup-java@v3
      with:
        java-version: 8
        distribution: zulu
    - name: Gradle Wrapper Validation
      uses: gradle/wrapper-validation-action@v1
    - name: Gradle Build Action
      uses: gradle/gradle-build-action@v2
      with:
        arguments: |
          --no-daemon
          --parallel
          --stacktrace
          -PbuildVersion=${{github.run_number}}
          :protocol:build
          :protocol-serialization:build
          :protocol-mod:build
          :mod:build
          :graffiti:build
          :graffiti-protocol:build
          :graffiti-service:build
          :api:build
          :backport-artifact:build
          publish
      env:
        CRI_REPO_LOGIN: ${{ secrets.CRI_REPO_LOGIN }}
        CRI_REPO_PASSWORD: ${{ secrets.CRI_REPO_PASSWORD }}
